#pragma once
#include "AnimationCommon.h"
#include "ParticleData.h"

class CConstraint
{
public:
	explicit CConstraint(int vNumOfParticles) : m_NumOfParticles(vNumOfParticles)
	{
		m_ParticleIndices = new int[vNumOfParticles];
	}
	virtual ~CConstraint()
	{
		delete[] m_ParticleIndices;
	}

	virtual bool solveConstraintV(CParticleData& vParticleData) = 0;

	int getNumOfParticles() const { return m_NumOfParticles; }
	int getParticleIndice(int vIndex) const { return m_ParticleIndices[vIndex]; }
	Eigen::Matrix3d getRotationMatrix() const { return m_RotationMatrix; }

protected:
	int m_NumOfParticles = -1;
	int* m_ParticleIndices;
	Eigen::Matrix3d m_RotationMatrix = Eigen::Matrix3d::Zero();
};